import * as BABYLON from "babylonjs";

export const framerate = 10;
export const rightDoorAnim = new BABYLON.Animation(
  "animation",
  "rotation.y",
  framerate,
  BABYLON.Animation.ANIMATIONTYPE_FLOAT,
  BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT,
);
const rightDoorAnimKeysFrames = [];
rightDoorAnimKeysFrames.push({
  frame: 0,
  value: 0,
});
rightDoorAnimKeysFrames.push({
  frame: framerate,
  value: -BABYLON.Tools.ToRadians(70),
});
rightDoorAnim.setKeys(rightDoorAnimKeysFrames);
//左侧车门
export const leftDoorAnim = new BABYLON.Animation(
    "animation",
    "rotation.y",
    framerate,
    BABYLON.Animation.ANIMATIONTYPE_FLOAT,
    BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT,
);
const leftDoorAnimKeysFrames = [];
leftDoorAnimKeysFrames.push({
  frame: 0,
  value: 0,
});
leftDoorAnimKeysFrames.push({
  frame: framerate,
  value: -BABYLON.Tools.ToRadians(-70),
});
leftDoorAnim.setKeys(leftDoorAnimKeysFrames);
//后备箱门
export const backDoorAnim = new BABYLON.Animation(
    "animation",
    "rotation.x",
    framerate,
    BABYLON.Animation.ANIMATIONTYPE_FLOAT,
    BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT,
);
const backDoorAnimKeysFrames = [];
backDoorAnimKeysFrames.push({
  frame: 0,
  value: 0,
});
backDoorAnimKeysFrames.push({
  frame: framerate,
  value: -BABYLON.Tools.ToRadians(-70),
});
backDoorAnim.setKeys(backDoorAnimKeysFrames);